#include <iostream>
#include <unordered_map>
using namespace std;

int main()
{
	int arr[] = {-3,-9,-7,10,3,6,4,20,2,1};
	unordered_map<int, bool> hash;
	int maxnum = 0;
	int n = sizeof(arr) / sizeof(int);
	int size = 0;
	for (int i = 0; i < n; i++)
	{
		if (arr[i] > 0)
		{
			maxnum = max(arr[i], maxnum);
			hash[arr[i]] = true;
			size++;
		}
	}
	if (size == maxnum) cout << maxnum + 1 << endl;
	else
	{
		int i = 1;
		while (hash.find(i) != hash.end())i++;
		cout << i << endl;
	}
	

	return 0;
}